/*
 * BBActionNextWave.java
 *
 * Created on March 11, 2008, 7:41 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package hextd.blackBox;

import hextd.core.Context;

/**
 *
 * @author hylke
 */
public class BBActionNextWave implements BBAction {

	private static final BlackBox.ActionType type = BlackBox.ActionType.NextWave;
	private int gameTime;

	/** Creates a new instance of BBActionNextWave */
	public BBActionNextWave(int gameTime) {
		this.gameTime = gameTime;
	}

	@Override
	public BlackBox.ActionType getType() {
		return BBActionNextWave.type;
	}

	@Override
	public int getGameTime() {
		return this.gameTime;
	}

	@Override
	public void execute(Context c) {
		//System.out.println("BBActionNextWave::execute: "+c.gameTime+" Sending next Wave.");
		if (!c.getBlackBox().nextWave(gameTime)) {
			System.err.println("BBActionNextWave::execute: " + gameTime + " Sync error: Not all enemies dead yet. Left: " + c.getEnemyCount());
		}
	}

	@Override
	public String getString() {
		return "" + this.gameTime + " W";
	}
}
